package com.ljb.android.component.user

import android.content.Context
import android.os.Bundle
import com.ljb.android.comm.router.core.IRouterInterceptor
import com.ljb.android.comm.router.core.RouterManager
import com.ljb.android.comm.utils.XLog
import com.ljb.android.component.user.router.UserRouter
import com.ljb.android.component.user.router.call.UserInfoRouterCall

object UserInit {

    fun init(context: Context) {
        initRouter()
    }

    private fun initRouter() {
        // 注册获取用户信息的Scheme路由
        RouterManager.registerRouterCall(UserRouter.Call.GET_USER_INFO, UserInfoRouterCall())

//        RouterManager.addInterceptor(object : IRouterInterceptor {
//            override fun onIntercept(context: Context, path: String, bundle: Bundle): Boolean {
//                XLog.i("拦截器：优先级5")
//                return false
//            }
//        }, 5)
//
//        RouterManager.addInterceptor(object : IRouterInterceptor {
//            override fun onIntercept(context: Context, path: String, bundle: Bundle): Boolean {
//                XLog.i("拦截器：优先级1")
//                return false
//            }
//        }, 1)
//
//        RouterManager.addInterceptor(object : IRouterInterceptor {
//            override fun onIntercept(context: Context, path: String, bundle: Bundle): Boolean {
//                XLog.i("拦截器：优先级4")
//                return false
//            }
//        }, 4)
//
//        RouterManager.addInterceptor(object : IRouterInterceptor {
//            override fun onIntercept(context: Context, path: String, bundle: Bundle): Boolean {
//                XLog.i("拦截器：优先级2")
//                return false
//            }
//        }, 2)
//
//        RouterManager.addInterceptor(object : IRouterInterceptor {
//            override fun onIntercept(context: Context, path: String, bundle: Bundle): Boolean {
//                XLog.i("拦截器：优先级3")
//                return false
//            }
//        }, 3)
    }
}